﻿
namespace BEGDC.PreContract.DAL
{
    using System;
    using System.Collections.Generic;
    using Castle.ActiveRecord;
    using NHibernate.Expression;


    [ActiveRecord]
    public partial class Email : ActiveRecordBase<Email>
    {
		#region Const Definition
		
		public const string CONST_EmailID								= "EmailID";
		public const string CONST_ClassName								= "ClassName";
		public const string CONST_PreContractID							= "PreContractID";
		public const string CONST_EmailContent							= "EmailContent";
		public const string CONST_CC									= "CC";
		public const string CONST_Subject								= "Subject";
		public const string CONST_IsSend								= "IsSend";
		public const string CONST_SendTime								= "SendTime";

		#endregion
		
        #region Member Variables
        // Primary Key
        private System.Int32 _emailID;
        
        // Non Key
        private System.String _className;
        private Nullables.NullableInt32 _preContractID;
        private System.String _emailContent;
        private System.String _cC;
        private System.String _subject;
        private System.Boolean _isSend;
        private Nullables.NullableDateTime _sendTime;

        // Parents
        
        
		

        #endregion

        public Email() {
               
        }
        public Email(
            System.String className
            ,Nullables.NullableInt32 preContractID
            ,System.String emailContent
            ,System.String cC
            ,System.String subject
            ,System.Boolean isSend
            ,Nullables.NullableDateTime sendTime) : this() {
                
            this._className = className; 
            this._preContractID = preContractID; 
            this._emailContent = emailContent; 
            this._cC = cC; 
            this._subject = subject; 
            this._isSend = isSend; 
            this._sendTime = sendTime; 
        }
        
        #region Properties
        // Primary Key        
		
		#if (SQLServer)
        [PrimaryKey]
		#else
		[PrimaryKey(PrimaryKeyType.Native, SequenceName = "SEQ_EMAIL_EMAILID")]
		#endif
        public System.Int32 EmailID {
            get { return this._emailID; }
            set {  this._emailID = value; }
        }
        
        // Non Key
        [Property]
        public System.String ClassName {
            get { return this._className; }
			set { if (value == null) return; if (value.Length > 255) this._className = value.Substring(0,255); else this._className = value; }	
        }
        
        [Property]
        public Nullables.NullableInt32 PreContractID {
            get { return this._preContractID; }
			set { this._preContractID = value; }
        }
        
        [Property]
        public System.String EmailContent {
            get { return this._emailContent; }
			set { if (value == null) return; if (value.Length > 200) this._emailContent = value.Substring(0,200); else this._emailContent = value; }	
        }
        
        [Property]
        public System.String CC {
            get { return this._cC; }
			set { if (value == null) return; if (value.Length > 50) this._cC = value.Substring(0,50); else this._cC = value; }	
        }
        
        [Property]
        public System.String Subject {
            get { return this._subject; }
			set { if (value == null) return; if (value.Length > 200) this._subject = value.Substring(0,200); else this._subject = value; }	
        }
        
        [Property]
        public System.Boolean IsSend {
            get { return this._isSend; }
			set { this._isSend = value; }
        }
        
        [Property]
        public Nullables.NullableDateTime SendTime {
            get { return this._sendTime; }
			set { this._sendTime = value; }
        }
        
        
        // Parent Relationships
        // Child Relationships
        
		
        #endregion
		
		// Clone
		public Email Clone()
		{
			Email newEmail = new Email();
			
            newEmail.ClassName = this._className; 
            newEmail.PreContractID = this._preContractID; 
            newEmail.EmailContent = this._emailContent; 
            newEmail.CC = this._cC; 
            newEmail.Subject = this._subject; 
            newEmail.IsSend = this._isSend; 
            newEmail.SendTime = this._sendTime; 
			return newEmail;
		}
    }
}



